﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using MethodWorx.CMS.Content;
using MethodWorx.CMS.Services;

namespace MethodWorx.CMS.Requests
{
    public class UpdateContentTemplateBasicDetailsRequest : ContentTemplateBasicDetailsRequest
    {
        private ContentTemplateService service;

        public UpdateContentTemplateBasicDetailsRequest(ContentTemplateService service, Guid id) : base(service)
        {
            this.service = service;
            this.contentTemplate = service.GetContentTemplateById(id);
        }

        public override void Complete()
        {
            if (service == null)
                throw new ArgumentNullException("service");

            //  perform the request on the service
            this.service.UpdateContentTemplateBasicDetails(this);
        }
    }
}
